import { BasicColumn, FormSchema } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: 'ID',
    dataIndex: 'id',
    width: 100,
  },
  {
    title: '字典名称',
    dataIndex: 'name',
    // width: 160,
  },
  {
    title: '字典类型',
    dataIndex: 'type',
    // width: 200,
  },
  {
    title: '排序',
    dataIndex: 'order_no',
    // width: 200,
  },
  {
    title: '备注',
    dataIndex: 'remark',
    // width: 200,
  },
  {
    title: '创建时间',
    dataIndex: 'created_at',
    width: 180,
  },
];

export const columnsConfig: BasicColumn[] = [
  {
    title: '字典值',
    dataIndex: 'code',
  },
  {
    title: '字典标签',
    dataIndex: 'name',
  },
  {
    title: '排序',
    dataIndex: 'order_no',
    width: 50,
  },
  {
    title: '备注',
    dataIndex: 'remark',
  },
  // {
  //   title: '创建时间',
  //   dataIndex: 'created_at',
  //   width: 150,
  // },
];

export const searchConfigFormSchema: FormSchema[] = [
  {
    field: 'code',
    label: '字典值',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'name',
    label: '字典标签',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'wd_nt',
    component: 'Input',
    componentProps: {
      placeholder: '字典名称/类型',
    },
    colProps: { span: 8 },
  },
  // {
  //   field: 'type',
  //   label: '字典类型',
  //   component: 'Input',
  //   colProps: { span: 8 },
  // },
];

export const formSchema: FormSchema[] = [
  {
    field: 'name',
    label: '字典名称',
    component: 'Input',
    required: true,
  },
  {
    field: 'type',
    label: '字典类型',
    component: 'Input',
    required: true,
  },
  {
    field: 'order_no',
    label: '排序',
    component: 'InputNumber',
    required: true,
  },
  {
    field: 'remark',
    label: '备注',
    component: 'InputTextArea',
  },
];

export const formConfigSchema: FormSchema[] = [
  {
    field: 'code',
    label: '字典值',
    component: 'Input',
    required: true,
  },
  {
    field: 'name',
    label: '字典标签',
    component: 'Input',
    required: true,
  },
  {
    field: 'order_no',
    label: '排序',
    component: 'InputNumber',
    required: true,
  },
  {
    field: 'remark',
    label: '备注',
    component: 'InputTextArea',
  },
];
